<?php
if(isset($_GET['del']))
{
	$del=mysql_query("delete from banner_category where id='".$_GET['del']."'");
	echo "<script>window.location='index.php?tc=category&rem';</script>";
}
?>
	<form action="" method="post" enctype="multipart/form-data" name="form1">
	<div style="text-align:left; padding-left:10px; width:800px; padding-bottom:20px; float:left;"><strong>Home Page Banners</strong>
    <a href="index.php?tc=banners&add" class="font12" style="padding-left:350px;">Add New</a> | 
    <a href="index.php?tc=category" class="font12" style="padding-left:5px;">Category</a> |
    <a href="index.php?tc=addcategory" class="font12" style="padding-left:5px;">Add Category</a>
    </div>
    <div style="padding:5px 5px 5px 5px; width:800px; float:left;">
	<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="list">
    <thead>
    <tr>
      <td width="23%" height="25" align="center" valign="middle">id</td>
      <td width="43%" align="center" valign="middle">Category</td>
      <td width="17%" align="center" valign="middle">Status</td>
      <td width="17%" align="center" valign="middle">Action</td>
    </tr></thead>
    <?php
    $ads=mysql_query("select * from banner_category order by id DESC");
	while($banner=mysql_fetch_array($ads)){
	?>
      
      <tr>
        <td height="30" align="center" valign="middle" class="font12">
		<?php echo $banner['id'];?></td>
        <td align="center" valign="middle" class="font12"><?php echo $banner['category']?></td>
        <td align="center" valign="middle" class="font12">
		<?php echo ($banner['status']==1)? "Activate" : "Deactivate";?></td>
        <td align="center" valign="middle" class="font12">
        <a href="index.php?tc=addcategory&edit=<?php echo $banner['id']?>" class="font12">Edit</a>  | 
        <a href="index.php?tc=category&del=<?php echo $banner['id']?>" onclick="return confirm('Are you sure want to delete this?');" class="font12">Delete</a></td>
      </tr>
      <?php }
	  $tts=mysql_num_rows(mysql_query("select * from banner_category order by id DESC"));
	  if($tts<=0){
	  ?>
      <tr>
        <td height="30" colspan="4" align="center" valign="middle" class="red">~ No Record Found ~</td>
      </tr>
      <?php }?>
</table>
    </div>
</form>

